package com.ruoyi.project.goods.order.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.goods.order.mapper.GoodsOrderHeadMapper;
import com.ruoyi.project.goods.order.domain.GoodsOrderHead;
import com.ruoyi.project.goods.order.service.IGoodsOrderHeadService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 订单明细Service业务层处理
 * 
 * @author lonsn
 * @date 2020-11-12
 */
@Service
public class GoodsOrderHeadServiceImpl implements IGoodsOrderHeadService 
{
    @Autowired
    private GoodsOrderHeadMapper goodsOrderHeadMapper;

    /**
     * 查询订单明细
     * 
     * @param orderHeadId 订单明细ID
     * @return 订单明细
     */
    @Override
    public GoodsOrderHead selectGoodsOrderHeadById(Long orderHeadId)
    {
        return goodsOrderHeadMapper.selectGoodsOrderHeadById(orderHeadId);
    }

    /**
     * 查询订单明细列表
     * 
     * @param goodsOrderHead 订单明细
     * @return 订单明细
     */
    @Override
    public List<GoodsOrderHead> selectGoodsOrderHeadList(GoodsOrderHead goodsOrderHead)
    {
        return goodsOrderHeadMapper.selectGoodsOrderHeadList(goodsOrderHead);
    }

    /**
     * 新增订单明细
     * 
     * @param goodsOrderHead 订单明细
     * @return 结果
     */
    @Override
    public int insertGoodsOrderHead(GoodsOrderHead goodsOrderHead)
    {
        return goodsOrderHeadMapper.insertGoodsOrderHead(goodsOrderHead);
    }

    /**
     * 修改订单明细
     * 
     * @param goodsOrderHead 订单明细
     * @return 结果
     */
    @Override
    public int updateGoodsOrderHead(GoodsOrderHead goodsOrderHead)
    {
        return goodsOrderHeadMapper.updateGoodsOrderHead(goodsOrderHead);
    }

    /**
     * 删除订单明细对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteGoodsOrderHeadByIds(String ids)
    {
        return goodsOrderHeadMapper.deleteGoodsOrderHeadByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单明细信息
     * 
     * @param orderHeadId 订单明细ID
     * @return 结果
     */
    @Override
    public int deleteGoodsOrderHeadById(Long orderHeadId)
    {
        return goodsOrderHeadMapper.deleteGoodsOrderHeadById(orderHeadId);
    }
}
